<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>打印1到100, 遇到3的倍数则打印3的倍数, 遇到5的倍数则打印5的倍数, 遇到3和5的公倍数, 则打印3和5的公倍数</title>
</head>
<body>
  <script>
    let arr1 = [], arr2 = [], nums = []
    for (var i = 1; i <= 100; i++) {
      if (i % 3 == 0) arr1.push(i)
      if (i % 5 == 0) arr2.push(i)
      if (i % 3 == 0 && i % 5 == 0) nums.push(i)
    }
    console.log('3的倍数：' + arr1)
    console.log('5的倍数：' + arr2)
    console.log('3和5的倍数：' + nums)
  </script>
</body>
</html>